/*
 * @Description: 年度审核接口
 * @Author: Zzt
 * @Date: 2022-12-30 10:55:30
 * @LastEditTime: 2023-01-29 09:26:54
 */
import { IPageQuery } from '@/interfaces/global';
import request from '@/utils/request';
// 新增
export interface IAddAnnualParams {
  attachmentJsonDTOS?: AttachmentJSONDTO[];
  checkAttachmentJsonDTOS?: AttachmentJSONDTO[];
  checkDesc?: string;
  description?: string;
  guidanceUnitId?: number;
  id?: number;
  name?: string;
  remark?: string;
  year?: string;
}

export interface AttachmentJSONDTO {
  fileExt?: string;
  fileName?: string;
  fileNo?: number;
  filePath?: string;
  fileSize?: string;
  fileUrl?: string;
}
export function addAnnual(data: IAddAnnualParams) {
  return request({
    url: `/message-annual-inspection-review/`,
    method: 'post',
    data
  });
}
export interface IEditAnnualParams extends IAddAnnualParams {
  id: number;
}
// 修改
export function editAnnual(data: IEditAnnualParams) {
  return request({
    url: `/message-annual-inspection-review/`,
    method: 'put',
    data
  });
}
// 审核按钮功能
export function auditAnnualById(id: number | string) {
  return request({
    url: `/message-annual-inspection-review/audit/${id}`,
    method: 'post'
  });
}
// 提审
export function arraignmentAnnualById(id: number | string) {
  return request({
    url: `/message-annual-inspection-review/arraignment/${id}`,
    method: 'post'
  });
}
// 审核确认
export function auditConfirmAnnual(data: IEditAnnualParams) {
  return request({
    url: `/message-annual-inspection-review/auditConfirm/`,
    method: 'post',
    data
  });
}
// 分页查询

export interface ISearchAnnualParams {
  beginOperateTime?: string;
  beginReadTime?: string;
  beginSendTime?: string;
  endOperateTime?: string;
  endReadTime?: string;
  endSendTime?: string;
  AnnualUnitId?: number;
  instructedUnitId?: number;
  name?: string;
  operator?: number;
  operatorName?: string;
  readStatus?: number;
  sendStatus?: number;
  type?: number;
}

export function searchAnnualByPage(data: IPageQuery<ISearchAnnualParams>) {
  return request({
    url: `/message-annual-inspection-review/page/`,
    method: 'post',
    data
  });
}
// 通过id查询

export function findAnnualById(id: number | string) {
  return request({
    url: `/message-annual-inspection-review/${id}`,
    method: 'get'
  });
}

// 通过id删除
export function deleteAnnualList(id: number | string) {
  return request({
    url: `/message-annual-inspection-review/${id}`,
    method: 'delete'
  });
}
